﻿#ifndef PST_DIALOGWAVEFORMANALYSIS_H
#define PST_DIALOGWAVEFORMANALYSIS_H

#include <IdaDialogFrame>
#include <QModelIndexList>
#include <QStringListModel>
QT_BEGIN_NAMESPACE
namespace Ui
{
    class DialogWaveformAnalysis;
};
QT_END_NAMESPACE

namespace pst
{
    class DataChosenListDialog;
    class DialogWaveformAnalysis : public IdaDialogFrame
    {
        Q_OBJECT

    public:
        DialogWaveformAnalysis(QWidget* parent = nullptr);
        ~DialogWaveformAnalysis();
        void setCurveNameList(const QList<QString>& curveNameList);
        void setExtrapolationCoefficientList(const QList<QString>& extrapolationCoefficientList);
        void setInit(QStringList& params);

    signals:
        bool signal_sendAnalysisData(const QString& graphName, double cutOffFrequency, const QString& filterType, int filterOrder, double leftBoundary, double rightBoundary, int windowId, QString resultList, bool isPythonRun = false);

    public slots:
        void on_pushButton_confirm_clicked();
        void on_pushButton_cancel_clicked();

        void on_pushButton_Curve_clicked();
        void slot_sentChosenDataIds(const QModelIndexList& chosenID);

    private:
        bool AbnormalErrorJudgment();
        void updateValueRange();

        QModelIndexList createSelectedIndexes(const QStringList& params);

    private:
        Ui::DialogWaveformAnalysis* ui;
        DataChosenListDialog* m_dataChosenListDialog;
        QList<QString> m_curveNameList;
        QList<int> m_selectedIndexs;

        double m_minValue;             // 时域定义最小值
        double m_maxValue;             // 时域定义最大值
        double m_TimeDomainLeftValue;  // 时域定义左边
        double m_TimeDomainRightValue; // 时域定义右边

        QStringListModel m_model;
        bool m_edit;
    };
} // namespace pst

#endif
